﻿
namespace AttrapeMoi
{
    class Sommet
    {
        public const int INFINI = 1000000;
        public int Potentiel;
        public bool Marque;
        public Coord Pred;

        public Sommet()
        {
            Potentiel = INFINI;
            Marque = false;
            Pred = null;
        }

        public Sommet(int pot, int x, int y)
        {
            Potentiel = pot;
            Marque = false;
            Pred = new Coord(x, y);
        }
    }

    class Coord
    {
        int x;
        int y;

        public int X
        {
            get { return x; }
            set { x = value; }
        }

        public int Y
        {
            get { return y; }
            set { y = value; }
        }

        public Coord(int x_, int y_)
        {
            x = x_;
            y = y_;
        }

        public Coord(float x_, float y_)
        {
            x = (int)x_;
            y = (int)y_;
        }
        
        public static bool operator ==(Coord a, Coord b)
        {
            return (a.X == b.X && a.Y == b.Y);
        }

        public static bool operator !=(Coord a, Coord b)
        {
            return (a.X != b.X || a.Y != b.Y);
        }

        public static Coord operator +(Coord a, Coord b)
        {
            return new Coord(a.X + b.X, a.Y + b.Y);
        }
    }
}
